package com.cz.service;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import org.apache.ibatis.session.SqlSession;
import org.apache.log4j.Logger;

import com.cz.bean.AccessLog;
import com.cz.bean.User;
import com.cz.common.Page;
import com.cz.dao.AccessLogMapper;
import com.cz.util.DbUtil;

@Path("log")
public class AccessLogResource {
	static Logger logger = Logger.getLogger(AccessLogResource.class);
	SqlSession sqlSession = DbUtil.getSessionFactory().openSession();
	AccessLogMapper dao=sqlSession.getMapper(AccessLogMapper.class);
	
	
    @Path("/{id}")
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public AccessLog getByOther(@PathParam("id") int id) {
    	AccessLog log = null;
        try {
        	 Page page=new Page();
             page.setPageNo(1);
             List<AccessLog> healthAgentList= dao.findPage(page);
             logger.info(healthAgentList);
        } catch (Exception e)
        {
            logger.error("user getByOther failed: ", e);
        } finally {
            sqlSession.close();
        }
        return log;
    }
}
